j3deditor.bin.hierarchy.util
Class NormalCalculator

java.lang.Object
  extended by javax.swing.SwingWorker
      extended by j3deditor.bin.hierarchy.util.NormalCalculator
All Implemented Interfaces:
CancellableTask, java.lang.Runnable, java.util.concurrent.Future, java.util.concurrent.RunnableFuture

public class NormalCalculator
extends javax.swing.SwingWorker
implements CancellableTask

Utility for (re)calculating vertex normals.

Author:
Risto Seene

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.SwingWorker
javax.swing.SwingWorker.StateValue
 
Constructor Summary
NormalCalculator(GeometryManipulator gm)
          Creates an instance of NormalCalculator.
 
Method Summary
 void cancel(java.lang.Object sender)
          Cancels the computation if faces are being smoothed.
protected  java.lang.Object doInBackground()
          Computes normals.
 void recalculateFlat()
          Sets faces flat.
 void recalculateSmooth(boolean edges)
          Sets faces smooth.
 void setProgressChangeListener(ProgressChangeListener listener)
          Sets the ProgressChangeListener.
 
Methods inherited from class javax.swing.SwingWorker
addPropertyChangeListener, cancel, done, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, process, publish, removePropertyChangeListener, run, setProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NormalCalculator

public NormalCalculator(GeometryManipulator gm)
Creates an instance of NormalCalculator.

Parameters:
gm - GeometryManipulator which data will be manipulated by this NormalCalculator
Method Detail

doInBackground

protected java.lang.Object doInBackground()
                                   throws java.lang.Exception
Computes normals.

Specified by:
doInBackground in class javax.swing.SwingWorker
Throws:
java.lang.Exception
See Also:
SwingWorker.doInBackground()

recalculateFlat

public void recalculateFlat()
Sets faces flat.


recalculateSmooth

public void recalculateSmooth(boolean edges)
Sets faces smooth.

Parameters:
edges - specifies if the edges of selection is included

setProgressChangeListener

public void setProgressChangeListener(ProgressChangeListener listener)
Sets the ProgressChangeListener.

Parameters:
listener - new ProgressChangeListener

cancel

public void cancel(java.lang.Object sender)
Cancels the computation if faces are being smoothed.

Specified by:
cancel in interface CancellableTask
Parameters:
sender - doesn't do anything